package com.qlmy.cn.api

import com.qlmy.cn.bean.*
import okhttp3.MultipartBody
import retrofit2.http.*

/**
 * Created by zhoucl
 * Description: 所有请求接口定义
 */
interface ApiService {
    @GET
    suspend fun dynamicUrl(@Url url: String?): String?

    /**
     * 查询视频监控城市列表
     */
    @POST("/spt-main/app/queryVideoDepotNum")
    @FormUrlEncoded
    suspend fun queryVideoDepotNum(
            @Field("cityCode") cityCode: String = "root000000",
    ): ResultBean<MutableList<OrgBean>?>

    /**
     * 通过城市查询库点摄像头
     */
    @POST("/spt-main/app/queryVideoAlertDesc")
    @FormUrlEncoded
    suspend fun queryVideoAlertDesc(
            @Field("depotCode") depotCode: String,
    ): ResultBean<MutableList<OrgBean>?>

    /**
     * 通过摄像头id获取摄像头地址
     */
    @POST("/spt-main/app/queryPreviewURLs")
    @FormUrlEncoded
    suspend fun queryPreviewURLs(
            @Field("cameraIndexCode") cameraIndexCode: String,
    ): ResultBean<MutableList<OrgBean>?>

    /**
     * 检查单位
     */
    @POST("/spt-main/orgManage/queryOrg")
    @FormUrlEncoded
    suspend fun queryOrg(
            @Field("orgName") orgName: String,
            @Field("orgType") orgType: String = "企业机构",
    ): ResultBean<MutableList<OrgBean>?>

    /**
     * 被检企业名称
     */
    @POST("/spt-main/storeCompanyManage/listStoreCompany")
    @FormUrlEncoded
    suspend fun listStoreCompany(
            @Field("companyName") companyName: String,
            @Field("areaCode") areaCode: String = "440600",// 只查佛山的
    ): ResultBean<MutableList<StoreCompanyBean>?>

    /**
     * 地点查询
     */
    @POST("/spt-main/cbjhPlan/queryLocationByDw")
    @FormUrlEncoded
    suspend fun queryLocationByDw(
            @Field("dwdm") dwdm: String,
    ): ResultBean<MutableList<StoreLocationBean>?>

    /**
     * 违反条款
     */
    @GET("/spt-main/satefy/queryClause")
    suspend fun queryClause(): ResultBean<MutableList<ClauseBean>?>

    /**
     * 文件/图片上传
     */
    @POST("/spt-main/file/uploadFile")
    suspend fun uploadFile(@Body file: MultipartBody): ResultBean<String?>

    /**
     * 安全生产检查问题录入
     */
    @POST("/spt-main/aqjc/insertAqjc")
    @FormUrlEncoded
    @Headers(ConvertInterceptor.JSON_CONTENT_TYPE_HEADER)
    suspend fun insertAqjc(
            @Field("jcmc") jcmc: String,
            @Field("jcbm") jcbm: String?,
            @Field("bjcqy") bjcqy: String?,
            @Field("kddm") kddm: String?,
            @Field("kdmc") kdmc: String,
            @Field("jcr") jcr: String,
            @Field("lqssdw") lqssdw: Int,
            @Field("wtms") wtms: String,
            @Field("jclb") jclb: Int? = null,
            @Field("wftk") wftk: Int? = null,
            @Field("tpfj") tpfj: String? = null,
    ): ResultBean<String?>

    /**
     * 库存粮油分类月报汇总
     */
    @POST("/spt-main/sortMonthSend/querySortSummary")
    @FormUrlEncoded
    @Headers(ConvertInterceptor.JSON_CONTENT_TYPE_HEADER)
    suspend fun querySortSummary(
            @Field("spny") spny: String,
    ): ResultBean<MutableList<Map<String, Any>>?>

    /**
     * 储备粮油库存月报汇总明细
     */
    @POST("/spt-main/reserveMonthSend/queryReserveSummary")
    @FormUrlEncoded
    @Headers(ConvertInterceptor.JSON_CONTENT_TYPE_HEADER)
    suspend fun queryReserveSummary(
            @Field("sbny") sbny: String,
    ): ResultBean<MutableList<Map<String, Any>>?>

//    /**
//     * 获取所有系统用户（测试）
//     */
//    @POST("/rfidsoft/xcgk/api/sysUser/list")
//    @FormUrlEncoded
//    suspend fun sysUserList(
//            @Field(ConvertInterceptor.PARAM) param: String = ConvertInterceptor.PARAM
//    ): ResultBean<PageBean<UserInfoBean>?>
}
